// http://codereview.stackexchange.com/questions/14309/conversion-between-enum-and-string-in-c-class-header
// http://stackoverflow.com/questions/207976/how-to-easily-map-c-enums-to-strings


#include <iostream>


#include "../sql/parser/Keywords.h"

int main()
{

  Keywords_ptr keywods = Keywords::DEFAULT_KEYWORDS;
  // std::cout << " enum SELECT = " << tokenStringList.at(Token::SELECT) << std::endl;
  string_ptr all = make_string_ptr("ALL");
  // std::cout << " getKeywods " << keywods->getKeyword(all) << std::endl;
  string_ptr xxx = make_string_ptr("xxx");
  // std::cout << " getKeywods " << keywods->getKeyword(xxx) << std::endl;

  std::shared_ptr<std::unordered_map<std::string, Token_ptr>> tkmap = keywods->getKeywords();

  std::unordered_map<std::string, Token_ptr>::iterator it = tkmap->begin();

  for (; it != tkmap->end(); ++it)
  {
    std::cout << "key:" << it->first << ",value:" << it->second->getName() << ",index:" << it->second->get_index() << std::endl;
  }

  return 0;
}
